<?php

/**
 * Login form
 *
 * @author     Mon Zafra <monzee at gmail>
 * @copyright  (c)2009 Mon Zafra
 * @category   Mz
 * @package    modules
 * @subpackage admin
 * @license    http://mz-project.googlecode.com/svn/trunk/LICENSE    MIT License
 * @version    SVN: $Id: Login.php 47 2009-05-28 17:56:56Z monzee $
 */
class Admin_Form_Login extends Zend_Form
{
    public function init()
    {
        $decors = array(
            array('Label', array('separator' => '')),
            array('ViewHelper', array('separator' => '')),
            array('Errors', array('separator' => '')),
        );

        $this->addElement('text', 'username', array(
            'label' => 'Username: ',
            'required' => true,
            'decorators' => $decors,
            'class' => 'text',
            ));

        $this->addElement('password', 'password', array(
            'label' => 'Password: ',
            'required' => true,
            'decorators' => $decors,
            'class' => 'text',
            ));

        $this->addElement('checkbox', 'remember', array(
            'label' => 'Remember me',
            'decorators' => array(
                'ViewHelper',
                array('Label', array(
                        'placement' => 'append',
                        'class' => 'checkbox',
                    )),
                'Errors'
            ),
            ));

        $this->addElement('hidden', 'origin', array(
                'decorators' => array('ViewHelper')
            ));
        
        $this->addElement('submit', 'submit', array(
            'label' => 'Login',
            'decorators' => array('ViewHelper'),
            ));

        $this->addDecorator('Form');
        $this->addDecorator(array('FormClose' => 'HtmlTag'), array(
            'tag' => 'form',
            'closeOnly' => true,
            ));
    }

}